<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

    public function index() {

        $hour = date('H');
        if ($hour <= 11) {
            $welcome_msg = '早上好，欢迎。';
        } else if (11 < $hour && $hour <= 13) {
            $welcome_msg = '中午好，欢迎。';
        } else if (13 < $hour && $hour <= 17) {
            $welcome_msg = '下午好，欢迎。';
        } else if ($hour > 17) {
            $welcome_msg = '晚上好，欢迎。';
        }

        $data['welcome_msg'] = $welcome_msg;
//        $data['bgimg_num'] = mt_rand(0, 5);
        $data['bgimg_num'] = 0;
        $data['page_title'] = '登录';

        $this->load->view('welcome_message', $data);
    }

}
